package com.alstudio.ui.module.account;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.alstudio.R;
import com.alstudio.ui.base.TitleBarActivity;

public class LoginActivity extends TitleBarActivity {

	private final String TAG = "LoginActivity";

	private EditText eUsername;
	private EditText ePassword;
	private TextView tvForgetPwd;
	private Button btnLogin;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setupView(this, TAG);
	}

	@Override
	protected void setupView(Context context, String name) {
		// TODO Auto-generated method stub
		super.setupView(context, name);
		setTitleBarContentView(R.layout.login_layout);

		eUsername = (EditText) findViewById(R.id.et_username);
		ePassword = (EditText) findViewById(R.id.et_password);
		tvForgetPwd = (TextView) findViewById(R.id.tv_forget_pwd);
		btnLogin = (Button) findViewById(R.id.button_login);
		setViewClickListener();
	}

	@Override
	protected void setViewClickListener() {
		// TODO Auto-generated method stub
		super.setViewClickListener();
		eUsername.setOnClickListener(this);
		ePassword.setOnClickListener(this);
		tvForgetPwd.setOnClickListener(this);
		btnLogin.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.tv_forget_pwd:
			// 忘记密码
			break;
		case R.id.button_login:
			// 登陆
			doLogin();
			break;
		}
	}

	/**
	 * 执行登陆逻辑
	 */
	private void doLogin() {
		// showNoticeArea();
	}

	@Override
	protected void initData() {
		// TODO Auto-generated method stub
		
	}

}
